<?php //debug($dcategoria);die; ?>
<div class="row">
    <div class="col-md-12">
    <h3 class="page-title">Listado de Productos</h3>
               <!-- BEGIN SAMPLE TABLE PORTLET-->
               <div class="portlet box red">
                  <div class="portlet-title">
                     <div class="caption"><i class="icon-cogs"></i>Lista de Productos</div>
                     <div class="tools">
                        <a href="javascript:;" class="collapse"></a>
                     </div>
                  </div>
                  <div class="portlet-body">
                     <div class="table-responsive">
                        <table class="table table-hover">
                        <thead>
                           <tr>
                              <th>Categoria</th>
                              <th>Nombre</th>
                              <th>Descripcion</th>
                              <th>Caja</th>
                              <th>Precio</th>
                              <th>Acciones</th>
                           </tr>
                        </thead>
                        <tbody>
                        <?php foreach($productos as $pro):?>
                           <tr>
                              <td><?php echo $pro['Categoria']['nombre']?></td>
                              <td><?php echo $pro['Producto']['nombre'];?></td>                              
                              <td><?php echo $pro['Producto']['descripcion'];?></td>
                              <td><?php echo $pro['Producto']['caja'];?></td>   
                              <td><?php echo $pro['Producto']['precio'];?></td>
                              <td>
                              <a data-toggle="modal" href="#basic" onclick="$('#editar').load('<?php echo $this->Html->url(array('action' => 'ajaxedita',$pro['Producto']['id']));?>');"class="btn default btn-xs blue"><i class="icon-arrow-up"></i> EDITAR</a> 
                              <a data-toggle="modal" href="#basic" onclick="$('#editar').load('<?php echo $this->Html->url(array('action' => 'ajaxedita',$pro['Producto']['id']));?>');"class="btn default btn-xs red"><i class="icon-arrow-up"></i> EDITAR</a>
                              <?php echo $this->Html->link('Eliminar',array('action' => 'delete',$pro['Producto']['id']),array('escape' => false,'confirm' => 'Esta seguro de eliminar','class' => 'btn default btn-xs yellow'));?>
                              
                              
                              <?php //echo $this->Html->link('Eliminar',array('action' => 'elimina2',$pro['Producto']['id']),array('escape' => false,'confirm' => 'Esta seguro de eliminar'));?>
                              <!--<a data-toggle="modal" href="#basic" onclick="$('#editar').load('<?php //echo $this->Html->url(array('action' => 'ajaxedita',$pro['Producto']['id']));?>');">Editar</a>--> 
                              
                              </td>                              
                           </tr>
                        <?php endforeach;?>   
                        </tbody>
                        </table>
                     </div>
                  </div>
               </div>
               <!-- END SAMPLE TABLE PORTLET-->
            </div>

</div>
        <script>
    $(document).ready(function(){
    $('#mitabla').dataTable(
    {
        "aaSorting": [] 
    }
    );
});
    </script>